Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3841: Combine time and quantity plurals #5153

Conversation

aayushimathur6
Copy link
Collaborator

@aayushimathur6 aayushimathur6 commented Sep 16, 2023

Explanation

Fixes #3841

This PR involves Combining plurals and quantity strings from:
<string name="time_ago">%s ago</string>

and

<plurals name="minutes">
  <item quantity="one">a minute</item>
  <item quantity="other">%s minutes</item>
</plurals>

to

 <plurals name="minutes_ago">
    <item quantity="one">a minute ago</item>
    <item quantity="other">%s minutes ago</item>
  </plurals>

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing
BEFORE AFTER
Before after
arabicbefore afterarabic

@aayushimathur6 aayushimathur6 requested a review from a team as a code owner September 16, 2023 19:27
@adhiamboperes adhiamboperes self-assigned this Sep 18, 2023
Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aayushimathur6!

Some feedback:

  • There are some failing tests in TextViewBindingAdaptersTest as a result of the change. Please run the test class locally to find the failing tests or Interpret the CI results.
  • Please update the PR title as instructed in the essential checklist.

app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@oppiabot
Copy link

oppiabot bot commented Sep 19, 2023

Unassigning @adhiamboperes since the review is done.

@oppiabot
Copy link

oppiabot bot commented Sep 19, 2023

Hi @aayushimathur6, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!

@aayushimathur6 aayushimathur6 changed the title "added time_ago in plurals" "Fixes #3841 added time_ago in plurals" Sep 19, 2023
@aayushimathur6 aayushimathur6 changed the title "Fixes #3841 added time_ago in plurals" "Fix part of issue #3841 added time_ago in plurals" Sep 19, 2023
@aayushimathur6 aayushimathur6 changed the title "Fix part of issue #3841 added time_ago in plurals" "Fix part of #3841 added time_ago in plurals" Sep 19, 2023
@aayushimathur6
Copy link
Collaborator Author

aayushimathur6 commented Sep 19, 2023

Thanks @aayushimathur6!

Some feedback:

  • There are some failing tests in TextViewBindingAdaptersTest as a result of the change. Please run the test class locally to find the failing tests or Interpret the CI results.
  • Please update the PR title as instructed in the essential checklist.

updated

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aayushimathur6.

This solution is still incomplete since the fun getPluralString is still accepting 2 seperate stings. Since the time_ago string is nolonger needed or used, you need to refactor getPluralString so that where we are currently passing time_ago we replace it with pluralsResId.

At the same time, you need to remove the TODO comment in that method so that the TODO check will not fail.

app/src/main/res/values/strings.xml Show resolved Hide resolved
app/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
@aayushimathur6
Copy link
Collaborator Author

Thanks @aayushimathur6.

This solution is still incomplete since the fun getPluralString is still accepting 2 seperate stings. Since the time_ago string is nolonger needed or used, you need to refactor getPluralString so that where we are currently passing time_ago we replace it with pluralsResId.

At the same time, you need to remove the TODO comment in that method so that the TODO check will not fail.

done

@adhiamboperes adhiamboperes changed the title "Fix part of #3841 added time_ago in plurals" Fix #3841: Combine time and quantity plurals Sep 21, 2023
Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aayushimathur6, this looks good to me.

You are missing the screenshots that prove that the solution works. Can you add before(from develop) and after(from this branch) screenshots? They should show that the text displays correctly still, for both LTR and RTL.

@aayushimathur6
Copy link
Collaborator Author

Thanks @aayushimathur6, this looks good to me.

You are missing the screenshots that prove that the solution works. Can you add before(from develop) and after(from this branch) screenshots? They should show that the text displays correctly still, for both LTR and RTL.

done

@aayushimathur6
Copy link
Collaborator Author

Hi @aayushimathur6, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!

Thanks @aayushimathur6.

This solution is still incomplete since the fun getPluralString is still accepting 2 seperate stings. Since the time_ago string is nolonger needed or used, you need to refactor getPluralString so that where we are currently passing time_ago we replace it with pluralsResId.

At the same time, you need to remove the TODO comment in that method so that the TODO check will not fail.

done

@oppiabot
Copy link

oppiabot bot commented Sep 23, 2023

Unassigning @aayushimathur6 since a re-review was requested. @aayushimathur6, please make sure you have addressed all review comments. Thanks!

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @aayushimathur6!

@adhiamboperes adhiamboperes enabled auto-merge (squash) September 24, 2023 03:16
@oppiabot
Copy link

oppiabot bot commented Sep 24, 2023

Unassigning @adhiamboperes since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label Sep 24, 2023
@oppiabot
Copy link

oppiabot bot commented Sep 24, 2023

Hi @aayushimathur6, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks!

@adhiamboperes adhiamboperes merged commit 0898127 into oppia:develop Sep 24, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'time_ago' & quantity plurals should be combined
2 participants